﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SetSailModel
{
    public class Result<T>
    {
        public Result()
        {
            Code = ResultCode.Success;//默认成功
            Msg = "成功";
            JsonData = "";
            Count = 0;
        }

        /// <summary>
        /// 执行代码
        /// </summary>
        public ResultCode Code { get; set; }

        /// <summary>
        /// 操作信息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 受影响行数
        /// </summary>
        public int Count { get; set; }

        /// <summary>
        /// 显示信息
        /// </summary>
        public string JsonData { get; set; }

        /// <summary>
        /// 业务数据
        /// </summary>
        public T Data { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
    }

    public enum ResultCode
    {
        Success = 1,//成功
        Fail = 0,//失败
        Exception = -1//异常
    }
}
